MkLlm
:fa-brands-github: Show source on GitHub
Node for LLM-based text generation.¶
Example: Regular¶
The MkDocs Lantern
From Markdown’s quiet pages,
a little lantern grows—
MkDocs gathers every heading,
every link, and note, and knows
how to turn a folder’s whispers
into paths of polished light,
with a theme to frame the reading
and a search that shines at night.
One command, and files are traveling
through the browser, clean and clear;
what began as words in plain text
becomes a guide for all to hear.
So build the map, arrange the chapters,
let each reference find its place—
MkDocs makes a home for knowledge,
one bright page at a time.
**The MkDocs Lantern**
From Markdown’s quiet pages,
a little lantern grows—
MkDocs gathers every heading,
every link, and note, and knows
how to turn a folder’s whispers
into paths of polished light,
with a theme to frame the reading
and a search that shines at night.
One command, and files are traveling
through the browser, clean and clear;
what began as words in plain text
becomes a guide for all to hear.
So build the map, arrange the chapters,
let each reference find its place—
MkDocs makes a home for knowledge,
one bright page at a time.
<p><strong>The MkDocs Lantern</strong></p>
<p>From Markdown’s quiet pages,<br>
a little lantern grows—<br>
MkDocs gathers every heading,<br>
every link, and note, and knows</p>
<p>how to turn a folder’s whispers<br>
into paths of polished light,<br>
with a theme to frame the reading<br>
and a search that shines at night.</p>
<p>One command, and files are traveling<br>
through the browser, clean and clear;<br>
what began as words in plain text<br>
becomes a guide for all to hear.</p>
<p>So build the map, arrange the chapters,<br>
let each reference find its place—<br>
MkDocs makes a home for knowledge,<br>
one bright page at a time.</p>
Bases: MkText
__init__
¶
__init__(
user_prompt: str,
system_prompt: str | None = None,
model: str | ModelName = "openai:gpt-6-luna",
context: str | None = None,
extra_files: Sequence[str | PathLike[str]] | None = None,
**kwargs: Any
) -> None
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_prompt
|
str
|
Main prompt for the LLM |
required |
system_prompt
|
str | None
|
System prompt to set LLM behavior |
None
|
model
|
str | ModelName
|
LLM model identifier to use |
'openai:gpt-6-luna'
|
context
|
str | None
|
Main context string |
None
|
extra_files
|
Sequence[str | PathLike[str]] | None
|
Additional context files or strings |
None
|
kwargs
|
Any
|
Keyword arguments passed to parent |
{}
|
| Name | Children | Inherits |
|---|---|---|
| MkText mknodes.basenodes.mktext Class for any Markup text. |
graph TD
4031386596["mkllm.MkLlm"]
1315922923["mktext.MkText"]
3160803176["rendercache.TemplateRenderMixin"]
2751680898["builtins.object"]
1359323199["mknode.MkNode"]
1315922923 --> 4031386596
3160803176 --> 1315922923
2751680898 --> 3160803176
1359323199 --> 1315922923
2751680898 --> 1359323199
[metadata]
icon = "mdi:view-grid"
status = "new"
name = "MkLlm"
[examples.regular]
title = "Regular"
jinja = """
{{ "Write a poem about MkDocs" | MkLlm(model="openai:gpt-6-luna") }}
"""
# [output.markdown]
# template = """
# <div class="grid cards" markdown="1">
# {% for item in node.get_items() %}
# - {{ item | indent }}
# {% endfor %}
# </div>
# """